$(function () {
  let $email = $('#email')

  let $password = $('#password')

  let emailPatt = /^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/
  let passwordPatt = /^[a-z0-9_-]{6,18}$/

  $email.focusout(function () {
    let emailText = $email.val()
    if (!emailPatt.test(emailText)) {
      $('#warnEmail').show()
      console.log(emailText)
    } else {
      $('#warnEmail').hide()
    }
  })

  $password.focusout(function () {
    let passwordText = $password.val()
    if (!passwordPatt.test(passwordText)) {
      $('#warnPassword').show()
      console.log(passwordText)
    } else {
      $('#warnPassword').hide()
    }
  })
})
